Skip to content

Conversation

@febo
Copy link
Contributor

@febo febo commented Oct 17, 2024

Problem

Currently, the Rust renderer will generate code with clippy warnings when the account list is empty since it will unnecessarily use the length of the accounts (0 in this case) in calculations.

Solution

Update the rendering logic to test if the account list length is greater than 0 before using the value.

@febo febo requested a review from lorisleiva October 17, 2024 10:21
@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2024

🦋 Changeset detected

Latest commit: d32c20d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@codama/renderers-rust Patch
@codama/renderers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect 👌

@lorisleiva lorisleiva merged commit aa6dcd1 into main Oct 17, 2024
3 checks passed
@lorisleiva lorisleiva deleted the febo/rust-empty-account-fix branch October 17, 2024 10:33
@github-actions github-actions bot mentioned this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants